<template>
    <div>
        <van-nav-bar title="购物车" left-text="返回" left-arrow @click-left="() => { $router.push('/login/fl') }" />
        <van-empty v-if="!cartdata.length" image="https://fastly.jsdelivr.net/npm/@vant/assets/custom-empty-image.png"
            image-size="80" description="数据空空如也" />
        <div v-for="item in cartdata">
            <van-swipe-cell>
                <van-card :price="item.goods.goods_price" :title="item.goods.goods_name">
                    <template #thumb>
                        <van-checkbox v-model="item.checked"></van-checkbox>
                        <img src="" alt="">
                    </template>
                    <template #num>
                        <van-stepper v-model="item.number" theme="round" button-size="22" disable-input />
                    </template>
                </van-card>
                <template #right>
                    <van-button square text="删除" type="danger" class="delete-button" />
                </template>
            </van-swipe-cell>
        </div>
        <van-submit-bar :price="0" button-text="提交订单" @submit="onSubmit">
            <van-checkbox v-model="checked">全选</van-checkbox>
        </van-submit-bar>
    </div>
</template>

<script setup>
import { useCounterStore } from '@/stores/counter'
import { ref } from 'vue'
// 在组件内部的任何地方均可以访问变量 `store` ✨
const store = useCounterStore()
let cartdata = ref([])
let cart = () => {
    console.log(cartdata)
}
cart()


import { useRouter } from 'vue-router'
let router = useRouter()
let onSubmit = () => {
    router.push('/dd')
}
</script>

<style lang="scss" scoped></style>